package com.atguigu.guli.service.oss.controller;

import com.atguigu.guli.service.base.result.R;
import org.springframework.web.bind.annotation.*;

@RestController//远程访问,openfeign 只能处理restful风格的请求和相应
@RequestMapping("/admin/oss")
public class TestFeginController {


    @GetMapping("test1")
    public R test1(){
        System.out.println(" test1 接收到请求");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return R.ok();

    }

    @GetMapping("test2")
    public R test2(@RequestParam String name){
        System.out.println("========== test2 接收到请求 name: "+name);
        return R.ok();
    }

    @PostMapping("test3")
    public R test3(@RequestBody Teacher teacher){
        System.out.println(" test3 接收到请求 teacher" + teacher );
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return R.ok();
    }
}
